<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>

    <jsp:include page="/WEB-INF/jsp/include/head.jsp"/>
</head>
<body>

<ol class="breadcrumb">
    <li><strong>当前位置： </strong>评价管理</li>
    <li class="active">经办人评价</li>
</ol>


<div class="panel panel-info">
    <div class="panel-heading">
        <h3 style="display: inline-block" class="panel-title">查询</h3>
    </div>
    <div class="panel-body">
        <form id="form_search" class="form-horizontal row">
            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label  ">企业名称：</label>
                <div class="col-sm-8">
                    <input name="companyName" class="form-control " type="text">
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label  ">产品名称：</label>
                <div class="col-sm-8">
                    <input name="productName" class="form-control " type="text">
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="control-label col-sm-4 ">状　　态：</label>
                <div class="col-sm-8">
                    <select class="form-control " name="managerIsAssess">
                        <option value="">&nbsp;</option>
                        <option
                                <c:if test="${managerIsAssess==0}">selected</c:if> value="0">未评价
                        </option>
                        <option value="1">已评价</option>
                    </select>
                </div>
            </div>


            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label  ">核查日期：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <div class="input-group date form_date timeInput">
                       <span class="input-group-addon">
                          <span class="glyphicon glyphicon-calendar"></span>
                       </span>
                            <input class="form-control " type="text" name="startTime">
                        </div>
                        <span class="input-group-addon"
                              style="width: auto;padding-right: 3px;padding-left: 3px;border-width: 0px;background-color: transparent">
                          <span>~</span>
                       </span>
                        <div class="input-group date form_date timeInput">
                       <span class="input-group-addon">
                          <span class="glyphicon glyphicon-calendar"></span>
                       </span>
                            <input class="form-control " type="text" name="endTime">
                        </div>
                    </div>
                </div>
            </div>


            <div class="form-group col-sm-2">
                <div class="col-sm-8  col-sm-offset-4">
                    <button id="btn_search" type="button" class="btn btn-default "><span
                            class="glyphicon glyphicon-search"></span>&nbsp;查&nbsp;询&nbsp;</button>
                </div>
            </div>
        </form>

    </div>
</div>

<table id="table_data"></table>

<div class="modal fade" id="modal_ajax">
    <div class="modal-dialog  modal-lg ">
        <div class="modal-content ">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>


<script>

    var $table_data = $('#table_data'), $btn_search = $('#btn_search');

    $table_data.bootstrapTable({
        url: 'business/managerAssess/select',
        striped: true,
        cache: false,
        sidePagination: 'server',
        searchOnEnterKey: false,
        pageSize: 10,
        pageList: [10, 20, 50],
        pageNumber: 1,
        pagination: true,
        queryParams: function (params) {
            $.extend(params, $("#form_search").serializeObject());
            return params
        },
        columns: [
            {
                formatter: function (value, row, index) {
                    return [index + 1].join('');
                }
            },
            {
                field: 'businessCode',
                title: '核查计划编号'
            },
            {
                field: 'companyName',
                title: '企业名称'

            },
            {
                field: 'productName',
                title: '产品名称'

            },
            {
                field: 'endTime',
                title: '核查日期',
                formatter: function (value, row, index) {
                    return $.Helper.dataTimeHelper.int2DateString(value);
                }
            },
            {
                field: 'managerIsAssess',
                title: '操作',
                events: 'events',
                formatter: function (value, row, index) {
                    if (value == 1) {
                        return [
                            '<div class="btn-group btn-group-xs" role="group" >' +
                            '<a target="_blank" class="btn  btn-xs btn-default"  role="button"  href="static/plugin/pdfJs/web/viewer.html?file=<%=request.getContextPath() %>/business/managerAssess/pdf/' + row.id + '">' +
                            '<span class="glyphicon glyphicon-eye-open"></span> 预览</a>' +
                            '<a  class="btn  btn-xs  btn-default"  role="button" href="business/managerAssess/doc/' + row.id + '">' +
                            '<span class="glyphicon glyphicon-cloud-download"></span> 下载</a>'
                            + '</div>'
                        ].join('');
                    } else {
                        return [
                            '<button type="button"  class="btn btn-xs btn-default  btn-warning addReport">' +
                            '<span class="glyphicon glyphicon-edit"></span>&nbsp;填写 </button>'
                        ].join('');
                    }
                }
            }

        ]
    });

    window.events = {
        'click .addReport': function (e, value, row, index) {

            $('#modal_ajax').modal({
                backdrop: 'static',
                keyboard: false,
                show: true,
                remote: 'business/managerAssess/editDlg?businessId=' + row.id
            });
        }
    };


    $btn_search.click(function () {
        $table_data.bootstrapTable('refresh');
    });

    $.sysPlugin.clearModalRemoveData("modal_ajax");
    $.sysPlugin.initDateTimeInput();
    $.sysPlugin.initSimpleSelect2();
</script>


</body>
</html>